var gulp = require('gulp');//gulp库
var sass = require('gulp-sass');//处理sass
var postcss = require('gulp-postcss');//自动添加css前缀
var minifycss = require('gulp-minify-css');//压缩css



/*------------------默认任务----------------*/
gulp.task('default',function () {
    gulp.run('createSass');
});


/*------------------css预编译----------------*/
gulp.task('createSass', function(){
    gulp.src(['web/sass/*.scss','!web/sass/function.scss'])
        .pipe(sass())
        .pipe(postcss())
        .pipe(minifycss())
        .pipe(gulp.dest('web/css/'));
});
gulp.watch(["web/sass/*.scss"],['createSass']);


